module.exports = {
  title: '企业管理系统文档',
  description: '企业管理桌面客户端使用文档',
  head: [
    ['link', { rel: 'icon', href: '/images/favicon.ico' }],
    ['script', {}, `
      const userPreference = localStorage.getItem('theme') || 'auto';
      
      if (userPreference === 'dark' || (userPreference === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
        document.documentElement.classList.add('dark');
      }

      window.toggleDarkMode = function() {
        const isDark = document.documentElement.classList.toggle('dark');
        localStorage.setItem('theme', isDark ? 'dark' : 'light');
      }
    `]
  ],
  themeConfig: {
    logo: '/images/logo.png',
    nav: [
      { text: '首页', link: '/' },
      { text: '指南', link: '/guide/' },
      { text: '常见问题', link: '/faq/' },
      { text: '下载', link: '/download/' },
      { text: 'API参考', link: '/guide/api-reference.html' },
      { 
        text: '关于我们', 
        items: [
          { text: '公司介绍', link: '/about/' },
          { text: '联系我们', link: '/about/contact.html' }
        ]
      },
      { 
        text: '切换模式', 
        link: 'javascript:void(0);',
        target: '_self',
        rel: '',
        onclick: 'toggleDarkMode()'
      }
    ],
    sidebar: {
      '/guide/': [
        {
          title: '指南',
          collapsable: false,
          children: [
            '',
            'introduction',
            'getting-started',
            'user-guide',
            'advanced-features',
            'configuration',
            'development',
            'api-reference',
            'security'
          ]
        }
      ],
      '/faq/': [
        {
          title: '常见问题',
          collapsable: false,
          children: [
            '',
            'installation',
            'usage',
            'sync'
          ]
        }
      ],
      '/about/': [
        {
          title: '关于我们',
          collapsable: false,
          children: [
            '',
            'contact'
          ]
        }
      ]
    },
    footer: '企业管理系统 | 邮箱: 1184490717@qq.com | 微信: arvinarvin123 | MIT Licensed',
    lastUpdated: '上次更新',
    smoothScroll: true
  },
  plugins: [
    '@vuepress/back-to-top',
    '@vuepress/medium-zoom',
    '@vuepress/nprogress'
  ],
  devServer: {
    open: true
  }
} 